<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="收房贷申请编号" prop="sfLoanOrderNo">
        <el-input
          v-model="queryParams.sfLoanOrderNo"
          placeholder="请输入收房贷申请编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="外部合同号" prop="outOrderNo">
        <el-input
          v-model="queryParams.outOrderNo"
          placeholder="请输入外部合同号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="外部金融产品名称，资方那边的名称" prop="outProductName">
        <el-input
          v-model="queryParams.outProductName"
          placeholder="请输入外部金融产品名称，资方那边的名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商户ID" prop="businessId">
        <el-input
          v-model="queryParams.businessId"
          placeholder="请输入商户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input
          v-model="queryParams.deptId"
          placeholder="请输入部门ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门编号" prop="deptNo">
        <el-input
          v-model="queryParams.deptNo"
          placeholder="请输入部门编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收房合同ID" prop="sfContractId">
        <el-input
          v-model="queryParams.sfContractId"
          placeholder="请输入收房合同ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="借款金额" prop="loanAmount">
        <el-input
          v-model="queryParams.loanAmount"
          placeholder="请输入借款金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="借款期限" prop="monthLimit">
        <el-input
          v-model="queryParams.monthLimit"
          placeholder="请输入借款期限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="利率" prop="rate">
        <el-input
          v-model="queryParams.rate"
          placeholder="请输入利率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="一次性服务费" prop="serviceFee">
        <el-input
          v-model="queryParams.serviceFee"
          placeholder="请输入一次性服务费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="金融产品ID" prop="jrProductId">
        <el-input
          v-model="queryParams.jrProductId"
          placeholder="请输入金融产品ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应收租约合计" prop="reLeaseCount">
        <el-input
          v-model="queryParams.reLeaseCount"
          placeholder="请输入应收租约合计"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="还款总额合计" prop="rpAmountCount">
        <el-input
          v-model="queryParams.rpAmountCount"
          placeholder="请输入还款总额合计"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="服务费" prop="serCharge">
        <el-input
          v-model="queryParams.serCharge"
          placeholder="请输入服务费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收房贷利息合计" prop="agInterestRate">
        <el-input
          v-model="queryParams.agInterestRate"
          placeholder="请输入收房贷利息合计"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="申请状态" prop="applyState">
        <el-input
          v-model="queryParams.applyState"
          placeholder="请输入申请状态，1:申请中，2：初审通过，3：初审不通过，4：复审通过，5：复审不通过"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="删除标识" prop="delFlg">
        <el-input
          v-model="queryParams.delFlg"
          placeholder="请输入删除标识 0：未删除，1：删除"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="常见用户ID" prop="createUserid">
        <el-input
          v-model="queryParams.createUserid"
          placeholder="请输入常见用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新用户ID" prop="updateUserid">
        <el-input
          v-model="queryParams.updateUserid"
          placeholder="请输入更新用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">确定</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>







  </div>
</template>

<script>
import { listLoan, getLoan, delLoan, addLoan, updateLoan } from "@/api/finance/loan";

export default {
  name: "Loan",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 收房贷申请信息表格数据
      loanList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        sfLoanOrderNo: null,
        outOrderNo: null,
        outProductName: null,
        businessId: null,
        deptId: null,
        deptNo: null,
        sfContractId: null,
        loanAmount: null,
        monthLimit: null,
        rate: null,
        serviceFee: null,
        jrProductId: null,
        reLeaseCount: null,
        rpAmountCount: null,
        serCharge: null,
        agInterestRate: null,
        auditMemo: null,
        applyState: null,
        delFlg: null,
        createUserid: null,
        updateUserid: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {


    // 表单重置
    reset() {
      this.form = {
        id: null,
        sfLoanOrderNo: null,
        outOrderNo: null,
        outProductName: null,
        businessId: null,
        deptId: null,
        deptNo: null,
        sfContractId: null,
        loanAmount: null,
        monthLimit: null,
        rate: null,
        serviceFee: null,
        jrProductId: null,
        reLeaseCount: null,
        rpAmountCount: null,
        serCharge: null,
        agInterestRate: null,
        auditMemo: null,
        applyState: null,
        delFlg: null,
        createUserid: null,
        createTime: null,
        updateUserid: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },

    /** 导出按钮操作 */
    handleExport() {
      this.download('finance/loan/export', {
        ...this.queryParams
      }, `loan_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
